package com.study.datastructure.sort;

/**
 * 选择排序
 */
public class ChooseSort {

    static void sort1(int[] a){

        for(int i=0;i<a.length;i++){
            for (int j = i; j<a.length ; j++) {
                if(a[j]<a[i]){
                    int temp = a[j];
                    a[j] = a[i];
                    a[i] = temp;
                }
            }
        }
        for (int i = 0; i < a.length; i++) {
            System.out.println(a[i]);
        }

    }
    public static void main(String[] args) {
        int[] a = new int[]{5,3,6,9,4,7,0};
        sort1(a);
    }

}
